<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="ArrayUtils,es.yporqueno.utils.ArrayUtils,max,min,sum,unique" name="keywords">
<title>es.yporqueno.utils.ArrayUtils</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'ArrayUtils - API Documentation';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?es/yporqueno/utils/ArrayUtils.html&amp;es/yporqueno/utils/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;ArrayUtils</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class ArrayUtils"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">es.yporqueno.utils</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class ArrayUtils</td>
</tr>
</table>
<p></p>
 Clase estatica con utilidades para trabajar con Arrays en AS3.
 <p></p>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="http://www.yporqueno.es" target="mm_external">http://www.yporqueno.es</a>
</div>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#max()">max</a>(array:Array):Number</div>
<div class="summaryTableDescription">[static] Devuelve el valor máximo de un array numerico.</div>
</td><td class="summaryTableOwnerCol">ArrayUtils</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#min()">min</a>(array:Array):Number</div>
<div class="summaryTableDescription">[static] Devuelve el valor mínimo de un array numerico.</div>
</td><td class="summaryTableOwnerCol">ArrayUtils</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#sum()">sum</a>(array:Array, startIndex:int = 0, endIndex:int = 16777215):Number</div>
<div class="summaryTableDescription">[static]
  Devuelve la suma de un rango de elementos de la matriz original.</div>
</td><td class="summaryTableOwnerCol">ArrayUtils</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#unique()">unique</a>(array:Array):Array</div>
<div class="summaryTableDescription">[static] Devuelve un array con los elementos no repetidos.</div>
</td><td class="summaryTableOwnerCol">ArrayUtils</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="max()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">max</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function max(array:Array):Number</code><p> Devuelve el valor máximo de un array numerico.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">array</span>:Array</code> &mdash; Array numérico.
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code> &mdash; Valor máximo del array
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../utils/ArrayUtils.html#min()" target="">min()</a>
</div>
<br>
<span class="label">Example</span>
<br>  <div class='listing'><pre>
  
  import es.yporqueno.utils.ArrayUtils;
  
  var valores:Array = [2, 3, 4, -5];
  
  var maximo:Number = ArrayUtils.max(valores);
  trace(maximo);   // Devuelve 4 </pre></div>
  <p></p>
</div>
<a name="min()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">min</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function min(array:Array):Number</code><p> Devuelve el valor mínimo de un array numerico.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">array</span>:Array</code> &mdash; Array numérico.
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code> &mdash; Valor mínimo del array
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../utils/ArrayUtils.html#max()" target="">max()</a>
</div>
<br>
<span class="label">Example</span>
<br>  <div class='listing'><pre>
  
  import es.yporqueno.utils.ArrayUtils;
  
  var valores:Array = [2, 3, 4, -5];
  
  var minimo:Number = ArrayUtils.min(valores);
  trace(minimo);   // Devuelve -5 </pre></div>
  <p></p>
</div>
<a name="sum()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">sum</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function sum(array:Array, startIndex:int = 0, endIndex:int = 16777215):Number</code><p>
  Devuelve la suma de un rango de elementos de la matriz original. Se suma desde el elemento <code>startIndex</code> hasta <code>endIndex</code>, sin incluir éste. 
  </p><p>Si no se pasa ningún parámetro, devolverá la suma completa de la matriz original.</p>
  <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">array</span>:Array</code> &mdash; Array numérico que se desea sumar.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">startIndex</span>:int</code> (default = <code>0</code>)<code></code> &mdash; posición inicial del intervalo que se quiere sumar.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">endIndex</span>:int</code> (default = <code>16777215</code>)<code></code> &mdash; posición final del intervalo que se quiere sumar
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code> &mdash; Suma del intervalo de valores numéricos del array
  </td>
</tr>
</table>
<br>
<span class="label">Example</span>
<br>  <div class='listing'><pre>
  
  import es.yporqueno.utils.ArrayUtils;
  
  var valores:Array = [2, 3, 4];
  
  var suma:Number = ArrayUtils.sum(valores);
  trace(suma);   // Devuelve 9 (2+3+4)
  
  suma = ArrayUtils.sum(valores, 1);
  trace(suma);   // Devuelve 7 (3+4)
  
  suma = ArrayUtils.sum(valores, 0, 2);
  trace(suma);    // Devuelve 5 (2+3) </pre></div>
  <p></p>
</div>
<a name="unique()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">unique</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function unique(array:Array):Array</code><p> Devuelve un array con los elementos no repetidos. Hace una comprobacion estricta.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">array</span>:Array</code> &mdash; Array de valores.
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code> &mdash; Array con los valores no repetidos
  </td>
</tr>
</table>
<br>
<span class="label">Example</span>
<br>  <div class='listing'><pre>
  
  import es.yporqueno.utils.ArrayUtils;
  
  var valores:Array = ["Iván", "Pepe", "Manolo", "Pepe", "Iván"];
  
  var unicos:Array = ArrayUtils.unique(valores);
  trace(unicos);   // Devuelve ["Iván", "Pepe", "Manolo"]; </pre></div>
  <p></p>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
